<%@page language="java" contentType="text/html; charset=UTF-8" %>
<%@page import="btsm.bean.BTSPage,java.sql.*,btsm.bean.sqlBTSWork"%>
<%!ResultSet rs;%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<%
        BTSPage mypage = new BTSPage("transformer", "");
		sqlBTSWork mysea = new sqlBTSWork("transformer", "");
%>
<%
            String jspName = request.getRequestURI();
            jspName = jspName.substring(jspName.lastIndexOf("/") + 1);
	        String strToPage = request.getParameter("ToPage");
		    String strbtsname = request.getParameter("btsname");
			String strbtscode = (String) request.getAttribute("btscode");
			String strsnid = (String) request.getAttribute("snid");	
			if(strsnid == null || strsnid.equals("null"))
				strsnid = "";				
%>
<%String titlename="变压器";%>
<script language="javascript" src="jscheck.js">
</script>
<HTML>
<HEAD>
<TITLE><%=titlename%>管理</TITLE>
<META http-equiv=Content-Type content="text/html; charset=UTF-8">
<LINK href="Admin_Style.css" type=text/css rel=stylesheet>
</HEAD>
<BODY style="margin:2px; overflow:auto">
<script>
    <!--
    function tst(obj0,obj1,obj2){
        obj0.style.border="1 "+obj1+" solid";
        obj0.style.background=obj2;
    }
    //-->
	function btnReturn(){
	     document.frmReturn.submit();
	}
</script>
<script>
	function btnRinsertS(){
		document.Jz_myform.seraction.value="serinsertsimple";
		document.Jz_myform.submit();
	}
	function btnModifyU(){
		document.Jz_myform.seraction.value="sermod";
		document.Jz_myform.submit();
	}
</script>
<SCRIPT LANGUAGE="JavaScript">
    <!--
    function textCounter(field, maxlimit) {
        if (field.value.length > maxlimit)
            field.value = field.value.substring(0, maxlimit);
    }
    //-->
</SCRIPT>
<SCRIPT>
    function tjsj(x){
        document.Jz_myform.snid.value=x;
		document.Jz_myform.seraction.value="serdel";
        if(confirm('确认要删除流水号为'+x+'的记录吗？'))
        	document.Jz_myform.submit();     
    }

    function tjsjx(x){
        document.Jz_myform.snid.value=x;
		document.Jz_myform.seraction.value="sermodp";
        document.Jz_myform.submit();
    }
</SCRIPT>
<TABLE cellSpacing=0 cellPadding=0 width="100%" border=0>
  <TBODY>
  
  <!--*********搜索工具条开始*****************-->
  <!--*********搜索工具条结束*****************-->
  <!--*************列表显示开始****************-->
  <TR>
  
  <TD>
  
  <TABLE cellSpacing="0" cellPadding="0" width="100%" border="0">
    <TR>
    
    <TD>
    
    <TABLE class="border" cellSpacing="1" cellPadding="2" width="100%" align="center" border="0">
      <FORM name="hj_myform" action="ser_cableRPole" method="post">
        <TBODY id=Tabs>
          <!--光缆管理列表表头开始-->
          <TR class=title align=middle height=2l2>
            <TD>流水号</TD>
            <TD>基站编号</TD>
            <TD>基站名称</TD>
            <TD>型号</TD>
            <TD>容量</TD>
            <TD>厂家</TD>
			<TD>变压器产权</TD>
            <TD colspan="2"><p align="center">操作</p></TD>
          </TR>
          <!--光缆管理列表列表表头结束-->
          <!--基站地理环境管理记录开始-->
          <%
		String strValues[] = new String[10];
		String strAddValues[] = new String[10];
		String idtmp;

        rs = mypage.myBTSFQuery(request, response, 1, 10, strbtscode);

        while (rs.next()) {
				
            %>
          <TR class=tdbg onMouseOver="this.className='tdbgmouseover'" onMouseOut="this.className='tdbg'" align=middle>
            <TD><%=rs.getString(1)%></TD>
            <TD><%=rs.getString(2)%></TD>
            <TD><%=rs.getString(3)%></TD>
            <TD><%=rs.getString(4)%></TD>
            <TD><%=rs.getString(5)%></TD>
            <TD><%=rs.getString(6)%></TD>
            <TD><%=rs.getString(7)%></TD>
            <TD align="center"><a href="javascript:tjsjx('<%=rs.getString(1)%>')">修改</a></TD>
            <TD align="center"><a href="javascript:tjsj('<%=rs.getString(1)%>')">删除</a></TD>
          </TR>
          <!--基站地理环境管理记录结束-->
          <%
		  	strAddValues[0] = rs.getString("tranPowerType");
			strAddValues[1] = rs.getString("tranMaintain");
			strAddValues[2] = rs.getString("tranHighLen");
			strAddValues[3] = rs.getString("tranLowLen");
			strAddValues[4] = rs.getString("tranRValue");
			strAddValues[5] = rs.getString("tranStartTime");
			
	 		idtmp = rs.getString(1);
			if(strsnid.equals(""))
	        {
    	        strsnid = rs.getString(1);
        	}
			if(strsnid.equalsIgnoreCase(idtmp))
			{
				for(int i = 0; i < 10; ++i)
				{
						strValues[i] = rs.getString(i+1);
				}
			}		

        }
        String footer = mypage.PageFooter("ser_bts?seraction=sermodp&btscode="+strbtscode+"&filesnames="+jspName+"&");
            %>
        <% 
			rs.close();
        	mypage.dbConClose();
		%>
        <p align="left">
      </FORM>
      </p>
      
      </TD>
      
      </TR>
      
      <TR class=tdbg onMouseOver="this.className='tdbgmouseover'" onMouseOut="this.className='tdbg'" align=middle>
        <TD colspan="13"><p align="center">
          <div class="article-bottom">
            <div class="pages">
              <%out.println(footer);%>
            </div>
          </div>
          <!--article-bottom -->
          <!--content -->
          <!--mainWrapper -->
          <div id="footer">
            <div id="innerFooter"></div>
          </div></TD>
      </TR>
      </TBODY>
      
    </TABLE>
    </TD>
    </TR>
  </TABLE>
  </TD>
  
  </TR>
  
  <!--************列表显示结束****************-->
  <TR>
    <TD><TABLE class=border cellSpacing=1 cellPadding=2 width="100%" align=center border=0>
        <FORM name="Jz_myform" action="ser_tran" method="post">
          <!--更改-->
          <!--添加数据表单开始-->
          <TBODY id=Tabs>
            <TR class=tdbg>
              <TD class=tdbg5 height="26">流水号：</TD>
              <TD height="26"><%=strValues[0]%>
                <input type="hidden" name="T1" size="46" value="<%=strValues[0]%>" maxlength="20" onBlur="chk(this.value,this)">
              </TD>
              <TD class=tdbg5 height="26">基站编号：</TD>
              <TD height="26"><%=strValues[1]%>
                <input type="hidden" name="T1" size="46" value="<%=strValues[1]%>" maxlength="12" onBlur="checkQuote(this.value,this)">
              </TD>
            </TR>
            <TR class=tdbg>
              <TD class=tdbg5 height="26">基站名称：</TD>
              <TD height="26"><%=strValues[2]%>
                <input type="hidden" name="T1" size="46" value="<%=strValues[2]%>" maxlength="20" onBlur="checkQuote(this.value,this)">
              </TD>
              <TD class=tdbg5 height="26">型号：</TD>
              <TD height="26"><input type="text" name="T1" size="46" class=text2d value="<%=strValues[3]%>" maxlength="24" onBlur="checkQuote(this.value,this)"></TD>
            </TR>
            <tr class=tdbg>
              <TD class=tdbg5 height="26">容量：</TD>
              <TD height="26"><input type="text" name="T1" size="49" class=text2d value="<%=strValues[4]%>" maxlength="24" onBlur="checkQuote(this.value,this)">
              </TD>
              <TD class=tdbg5 height="26">厂家：</TD>
              <TD height="26"><input type="text" name="T1" size="46" class=text2d value="<%=strValues[5]%>" maxlength="24" onBlur="checkQuote(this.value,this)">
              </TD>
            </tr>
            <tr class=tdbg>
              <TD class=tdbg5 height="18">变压器产权：</TD>
              <TD height="18"><input type="text" name="T1" size="50" class=text2d value="<%=strValues[6]%>" maxlength="24" onBlur="checkQuote(this.value,this)"></TD>
              <TD class=tdbg5 height="18">维修及更换记录：</TD>
              <TD height="18"><input type="text" name="T1" size="47" class=text2d value="<%=strValues[7]%>" maxlength="24" onBlur="checkQuote(this.value,this)"><input type="hidden" name="T1" value=""></TD>
            </tr>
			<tr>
			 <TD class=tdbg5 height="26">电源类型：</TD>
				<td height="26"><select name="tranPowerType" size="1" id="tranPowerType" style="width: 140; height: 23" width="771">
                <option selected value="<%=strAddValues[0]%>"><%=strAddValues[0]%></option>
                <%
                        String[] tranPowerTypeVal = mysea.sclist("24");
                        for (int i = 0; i < tranPowerTypeVal.length; i++) {
                                        %>
                <option value="<%=tranPowerTypeVal[i]%>"><%=tranPowerTypeVal[i]%></option>
                <%
                        }
                                        %>
            </select></td>
			   <TD class=tdbg5 height="18">变压器维修及保养记录：</TD>
              <TD height="18"><input type="text" name="tranMaintain" size="50" class=text2d value="<%=strAddValues[1]%>" maxlength="24" onBlur="checkQuote(this.value,this)"></TD>
			</tr>
			<tr>
				<TD class=tdbg5 height="18">高压端距离：</TD>
				<TD height="18"><input type="text" name="tranHighLen" size="50" class=text2d value="<%=strAddValues[2]%>" maxlength="24" onBlur="checkQuote(this.value,this)"></TD>			   
				<TD class=tdbg5 height="18">低压端距离：</TD>
				<TD height="18"><input type="text" name="tranLowLen" size="50" class=text2d value="<%=strAddValues[3]%>" maxlength="24" onBlur="checkQuote(this.value,this)"></TD>
			</tr>
			<tr>
				<TD class=tdbg5 height="18">地阻值：</TD>
				<TD height="18"><input type="text" name="tranRValue" size="50" class=text2d value="<%=strAddValues[4]%>" maxlength="24" onBlur="checkQuote(this.value,this)"></TD>			  
				<TD class=tdbg5 height="18">启用时间：</TD>
				<TD height="18"><input type="text" name="tranStartTime" size="50" class="Wdate" value="<%=strAddValues[5]%>" maxlength="24" onBlur="checkQuote(this.value,this)"></TD>
			</tr>
          <TR class=tdbg>
            <TD class=tdbg5 height="19">备注：</TD>
            <TD colspan="3" height="19"><textarea rows="7" name="T1" id="T2" cols="60" class=text2d onPropertyChange="textCounter(T2,64)" onBlur="checks(this.value,this)"><%=strValues[9]%></textarea>
            </TD>
          </TR>
          <TR class=tdbg>
            <TD class=tdbg5 height="51" colspan="4"><p align="center">
                <input type="hidden" name="filesnames" value=<%=jspName%>>
                <input type="hidden" name="seraction" value="sermod">
                <input type="hidden" name="btscode" id="btscode" value="<%=strbtscode%>">
                <input type="hidden" name="btsname" id="btsname" value="<%=strbtsname%>">
                <input type="hidden" name="snid" id="snid" value="<%=strsnid%>">
                <input type="hidden" name="tToPage"  id="tToPage" value="<%=strToPage%>">
                <input type="button" value="增加" name="btnInsert" style="width: 72; height: 25" class=tx_button onMouseOver="tst(this,'blue','#ffffff')" onMouseOut="tst(this,'black','#e8e7fe')" onClick="btnRinsertS();">
                &nbsp;&nbsp;&nbsp;&nbsp;
                <input type="button" value="修改保存" name="JzB1" style="width: 72; height: 25" class=tx_button onMouseOver="tst(this,'blue','#ffffff')" onMouseOut="tst(this,'black','#e8e7fe')" onClick="btnModifyU();">
                &nbsp;&nbsp;&nbsp;&nbsp;
                <input type="reset" value="重置" name="JzB2" style="width: 72; height: 25" class=tx_button onMouseOver="tst(this,'blue','#ffffff')" onMouseOut="tst(this,'black','#e8e7fe')">
                &nbsp;&nbsp;&nbsp;&nbsp;
                <input type="button" value="返回" name="JzB4" style="width: 72; height: 25" class=tx_button onMouseOver="tst(this,'blue','#ffffff')" onMouseOut="tst(this,'black','#e8e7fe')" onClick="btnReturn();">
            </TD>
          </TR>
          </TBODY>
          
        </FORM>
      </TABLE>
      <FORM name="frmReturn" action="/btsm/nnlist_graph.jsp" method="post" target="_parent">
      </FORM></TD>
  </TR>
  </TBODY>
</TABLE>
</BODY>
</HTML>
